<script>
export default {
  name: "MySon2",
  data() {
    return {
      message: ''
    }
  },
  methods: {
    sendMessage2() {
      this.$emit('testMessage', this.message)
    }
  }
}
</script>

<template>
    <div>
      <input type="text" v-model="message" />
      <button @click="sendMessage2">发送</button>
    </div>
</template>

<style scoped>

</style>